From 73f849e28dd97c26cf956ea68bd20146b8e08be6 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Fri, 13 Aug 2004 18:16:49 +0000 Subject: [PATCH] bitkeeper revision 1.1159.29.1 (411d0591E5q-eH5VYLKCC5XcKgmqCw) fixes --- tools/libxc/xc_linux_restore.c | 12 +++++++----- tools/libxc/xc_linux_save.c | 13 ++++++------- xen/common/dom0_ops.c | 6 +++++- xen/include/hypervisor-ifs/dom0_ops.h | 3 +++ 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index c50aae4052..0c1ca91ffc 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -11,7 +11,7 @@ #define MAX_BATCH_SIZE 1024 -#define DEBUG 0 +#define DEBUG 1 #if DEBUG #define DPRINTF(_f, _a...) printf ( _f , ## _a ) @@ -365,7 +365,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) goto out; } - switch( region_pfn_type[i] ) + switch( region_pfn_type[i] & LTABTYPE_MASK ) { case 0: break; @@ -473,8 +473,9 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) */ for ( i = 0; i < nr_pfns; i++ ) { - if ( pfn_type[i] == L1TAB ) + if ( pfn_type[i] == (L1TAB|LPINTAB) ) { +printf("XXXXXXXXXXXXXXX pin L1\n"); if ( add_mmu_update(xc_handle, mmu, (pfn_to_mfn_table[i]<> PAGE_SHIFT; - if ( (pfn >= nr_pfns) || (pfn_type[pfn] != L2TAB) ) + if ( (pfn >= nr_pfns) || ((pfn_type[pfn]<ABTYPE_MASK) != L2TAB) ) { printf("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n", pfn, nr_pfns, pfn_type[pfn], (unsigned long)L2TAB); diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index 1d4a054257..c3089955c9 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -13,7 +13,7 @@ #define BATCH_SIZE 1024 /* 1024 pages (4MB) at a time */ #define DEBUG 1 -#define DDEBUG 0 +#define DDEBUG 1 #if DEBUG #define DPRINTF(_f, _a...) printf ( _f , ## _a ) @@ -639,7 +639,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) set_bit( n, to_fix ); if( iter>1 ) - DDPRINTF("netbuf race: iter %d, pfn %lx. mfn %lx\n", + DDPRINTF("netbuf race: iter %d, pfn %x. mfn %lx\n", iter,n,pfn_type[batch]); continue; } @@ -658,7 +658,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) batch++; } - DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n); +// DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n); if ( batch == 0 ) goto skip; /* vanishingly unlikely... */ @@ -714,12 +714,12 @@ printf("type fail: page %i mfn %08lx\n",j,pfn_type[j]); continue; } - if ( ((pfn_type[j] & LTAB_MASK) == L1TAB) || - ((pfn_type[j] & LTAB_MASK) == L2TAB) ){ + if ( ((pfn_type[j] & LTABTYPE_MASK) == L1TAB) || + ((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ){ memcpy(page, region_base + (PAGE_SIZE*j), PAGE_SIZE); for ( k = 0; - k < (((pfn_type[j] & LTAB_MASK) == L2TAB) ? + k < (((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ? (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT) : 1024); k++ ){ @@ -898,7 +898,6 @@ printf("nrpfns according to suspend record is %ld\n", p_srec->nr_pfns ); /* Canonicalise each GDT frame number. */ for ( i = 0; i < ctxt.gdt_ents; i += 512 ) { - ctxt.gdt_frames[i], live_mfn_to_pfn_table[ctxt.gdt_frames[i]]); if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) { xcio_error(ioctxt, "GDT frame is not in range of pseudophys map"); goto out; diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 0a4086ef6e..6c8abcb8f8 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -610,6 +610,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) if ( likely(get_page(page, d)) ) { unsigned long type = 0; + switch( page->u.inuse.type_info & PGT_type_mask ) { case PGT_l1_page_table: @@ -625,7 +626,10 @@ long do_dom0_op(dom0_op_t *u_dom0_op) type = L4TAB; break; } - l_arr[j] |= type; + + if ( page->u.inuse.count_info & PGC_guest_pinned ) + type |= LPINTAB; + l_arr[j] |= type; put_page(page); } else diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/hypervisor-ifs/dom0_ops.h index 8cea03fac2..ed6f9dbb37 100644 --- a/xen/include/hypervisor-ifs/dom0_ops.h +++ b/xen/include/hypervisor-ifs/dom0_ops.h @@ -178,8 +178,11 @@ typedef struct { #define L2TAB (2<<28) #define L3TAB (3<<28) #define L4TAB (4<<28) +#define LPINTAB (1<<31) #define XTAB (0xf<<28) /* invalid page */ #define LTAB_MASK XTAB +#define LTABTYPE_MASK (0x7<<28) + typedef struct { /* IN variables. */ memory_t pfn; /* 0: Machine page frame number to query. */ -- 2.30.2